1. Field of the Invention
The present general inventive concept relates to image compression, and more particularly, to a binary image compression apparatus and method, by which pattern matching is performed in a binary image using multiple thresholds and a result of the pattern matching is compressed.
2. Description of the Related Art
A binary image, such as a black and white image, includes an image component that can be distinguished by symbols, such as text, and an image component that cannot be distinguished by symbols, such as a picture. According to the JBIG2 standard, which is described in the ITU-T recommendation T.88, the image component that can be distinguished using symbols is compressed by an image encoding method based on symbol matching, and the remaining image components (i.e., that cannot be distinguished as symbols) are compressed using a content-based arithmetic encoding method or halftone encoding method. Data compressed using different encoding methods is transmitted in units of segments. In particular, the image component compressed using the image encoding method based on the symbol matching is expressed by a symbol dictionary segment and a symbol region segment. In the symbol dictionary segment, bitmaps of symbols repeatedly used in a binary image are compressed using a memory medium ring encoding method or the arithmetic encoding method, and information about a width and a height of each symbol is also compressed by Huffman encoding or the arithmetic encoding method. In the symbol region segment, a position of each symbol included in the binary image and an index of each symbol obtained from a symbol dictionary are compressed using the Huffman encoding method or the arithmetic encoding method.
A process of forming the symbol dictionary segment will now be explained.
First, an attempt is made to match a newly extracted symbol of the binary image with representative symbols existing in the symbol dictionary. If there is a matching symbol in the representative symbols of the symbol dictionary, the newly extracted symbol is encoded using the index of the matching symbol. If there is no matching symbol in the representative symbols of symbol dictionary, the newly extracted symbol is added to the symbol dictionary and is encoded using an index (i.e., a new index) that is given at this time. Thus, an attempt is made to match the newly extracted symbol with all the representative symbols existing in the symbol dictionary. At this time, either a method of using a first match or a method of using a best match is used to match the newly extracted symbol to the existing representative symbols in the symbol dictionary. In the method of using the first match, a first representative symbol having a matching score equal to or less than a threshold is determined as the matching result of the matching symbol in the representative symbols in the symbol dictionary. In the method of using the best match, a best matching score is determined as the matching result of the matching symbol after matching the newly extracted symbol with all the representative symbols existing in the symbol dictionary.
When employing the method of using the first match, the time taken for matching can be reduced, however, the accuracy of the matching is lower. When employing the method of using the best match, the accuracy of the matching is better, however, the time taken for the matching may increase.